struct cons {
    #define INPUT_BUF 256
    char ring[INPUT_BUF];
    uint8 bg;
    uint8 ed;
    uint8 cur;
    struct sleeplk rlk;
    struct sleeplk wlk;
};

void consinit ();
struct cons * getcons ();
int read_consko (struct ko * o, void * to,unsigned int sz);
int write_consko (struct ko * o, void * from,unsigned int sz);